bbb7ea155dc2b62a15cf03cbedc2d0261547a28e,src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigPluginActivator.java,GeneralConfigPluginActivator,start,#BundleContext#,95

Before Change


         * Wait for the first ProtocolProviderService to register in order to
         * start the auto-away functionality i.e. to call #startThread().
         */
        bundleContext.addServiceListener(this);

        if (logger.isInfoEnabled())
            logger.info("PREFERENCES PLUGIN... [REGISTERED]");

After Change


         */
        ServiceReference[] protocolRefs = bundleContext.getServiceReferences(
                ProtocolProviderService.class.getName(), null);
        if(protocolRefs != null && protocolRefs.length > 0)
        {
            try
            {
                synchronized (GeneralConfigPluginActivator.class)
                {
                    if (!startThreadIsCalled)
                    {
                        startThread();
                        startThreadIsCalled = true;
                    }
                }
            }
            catch(Throwable t)
            {
                // not supposed to happen
                logger.error("Error starting auto away thread", t);
            }
        }
        else
            bundleContext.addServiceListener(this);

        if (logger.isInfoEnabled())
            logger.info("PREFERENCES PLUGIN... [REGISTERED]");